//
//  WechatSportGuidView.swift
//  Alamofire
//
//  Created by 易先生 on 2022/8/11.
//

import UIKit
import MYModule

class WechatSportGuidView: View {
    
    override func makeUI() {
        self.addSubview(bgView)
        bgView.addSubview(iconImageView)
        bgView.addSubview(titleLabel)
        self.addSubview(nextImageView)
        
        bgView.snp.makeConstraints { make in
            make.top.leading.trailing.equalToSuperview()
            make.height.equalTo(44)
        }
        
        iconImageView.snp.makeConstraints { make in
            make.leading.equalToSuperview().offset(20)
            make.width.height.equalTo(CGSize(width: 28, height: 28))
            make.centerY.equalToSuperview()
        }
        
        titleLabel.snp.makeConstraints { make in
            make.leading.equalTo(iconImageView.snp.trailing).offset(10)
            make.centerY.equalToSuperview()
        }
        
        nextImageView.snp.makeConstraints { make in
            make.top.equalTo(bgView.snp.bottom).offset(10)
            make.centerX.equalToSuperview()
        }
    }
    
    public func configImageOrContent(imageName:String,title:String) {
        iconImageView.image = UIImage(named: imageName)?.setupImageTintColor(tintColor: UIColor.assist_FFFFFF)
        titleLabel.text = title
    }
    
    private lazy var bgView: View = {
        let bgView = View()
        bgView.backgroundColor = UIColor.theme
        bgView.layer.cornerRadius = 20
        return bgView
    }()
    
    private lazy var iconImageView: ImageView = {
        let iconImageView = ImageView()
        iconImageView.contentMode = .scaleAspectFit
        return iconImageView
    }()
    
   private lazy var titleLabel: Label = {
       let titleLabel = Label()
       titleLabel.textColor = UIColor.assist_FFFFFF
       titleLabel.font = Fonts.systemFont(ofSize: 16)
       return titleLabel
    }()
    
    public lazy var nextImageView: ImageView = {
        let nextImageView = ImageView()
        nextImageView.image = UIImage(named: "ic_mark")
        return nextImageView
    }()

}
